{% extends "buyer/base.html" %}

{% block title %}
    天天生鲜首页
{% endblock %}

{% block content %}
    <div class="center_con clearfix">
        <ul class="subnav fl">
			<li><a href="#model01" class="fruit">新鲜水果</a></li>
			<li><a href="#model02" class="seafood">海鲜水产</a></li>
			<li><a href="#model03" class="meet">猪牛羊肉</a></li>
			<li><a href="#model04" class="egg">禽类蛋品</a></li>
			<li><a href="#model05" class="vegetables">新鲜蔬菜</a></li>
			<li><a href="#model06" class="ice">速冻食品</a></li>
		</ul>

		<div class="slide fl">
			<ul class="slide_pics">
				<li><img src="/static/buyer/images/slide.jpg" alt="幻灯片"></li>
				<li><img src="/static/buyer/images/slide02.jpg" alt="幻灯片"></li>
				<li><img src="/static/buyer/images/slide03.jpg" alt="幻灯片"></li>
				<li><img src="/static/buyer/images/slide04.jpg" alt="幻灯片"></li>
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			<a href="#"><img src="/static/buyer/images/adv01.jpg"></a>
			<a href="#"><img src="/static/buyer/images/adv02.jpg"></a>
		</div>
	</div>
{#    {% for goods_type in goods_type_list %}#}
    {% for goods_type in result_list %}
	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model01">{{ goods_type.name }}</h3>
			<div class="subtitle fl">
				<span>|</span>
				<a href="#">鲜芒</a>
				<a href="#">加州提子</a>
				<a href="#">亚马逊牛油果</a>
			</div>
			<a href="/Buyer/goods_list/?type_id={{ goods_type.id }}" class="goods_more fr" id="fruit_more">查看更多 ></a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="/static/{{ goods_type.picture }}"></div>
			<ul class="goods_list fl">
{#                {% for goods in goods_type.goods_set.all %}#}
                {% for goods in goods_type.goods_list %}
				<li>
					<h4><a href="/Buyer/goods_detail/?goods_id={{ goods.id }}">{{ goods.goods_name }}</a></h4>
					<a href="/Buyer/goods_detail/?goods_id={{ goods.id }}"><img src="/static/{{ goods.goods_image }}"></a>
					<div class="prize">¥ {{ goods.goods_price }}</div>
				</li>
                {% endfor %}
			</ul>
		</div>
	</div>
    {% endfor %}
{% endblock %}


{% block script %}
    <script type="text/javascript" src="/static/buyer/js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="/static/buyer/js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="/static/buyer/js/slide.js"></script>
	<script type="text/javascript">
		BCSlideshow('focuspic');
		var oFruit = document.getElementById('fruit_more');
		var oShownum = document.getElementById('show_count');

		var hasorder = localStorage.getItem('order_finish');

		if(hasorder)
		{
			oShownum.innerHTML = '2';
		}

		oFruit.onclick = function(){
			window.location.href = 'list.html';
		}
	</script>
{% endblock %}


